﻿using OpenCvSharp;

using System;
using System.Collections.Generic;
using System.IO;

using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    /// <summary>
    /// 水平连接器
    /// </summary>
    [Filter("水平连接器",FilterType.Algorithm)]
    public class AlgorithmHCntracts : FilterBase
    {
        /// <summary>
        /// 要连接的图像
        /// </summary>
        [InputParameter("要连接的图像")]
        public IEnumerable<Mat> ConcatMats { get; set; }

        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            var ConcatResult = new Mat();
            List<Mat> mats = new List<Mat>();
            mats.AddRange(ConcatMats);
            Cv2.HConcat(mats, ConcatResult);
            return ResultData<Mat>.Accept(TextResource.concat_success, ConcatResult);
        }
    }
}
